import fetch from '@system.fetch';
//引入router模块，用户页面跳转
import qs from 'querystring';

export default {
    //定义参数
    data: {
        marqueeDir: 'left',
        marqueeCustomData: '今日还未检测，花上几分钟检测一下吧',

        lineData: [
            {
                strokeColor: '#85aefb',
                fillColor: '#cce5ff',
                data: [763, 550, 551, 554, 731, 654, 525, 696, 595, 628, 791, 505, 613, 575, 475, 553, 491, 680, 657, 716],
                gradient: true,
            }
        ],
        lineOps: {
            xAxis: {
                min: 0,
                max: 20,
                display: false,
            },
            yAxis: {
                min: 0,
                max: 1000,
                display: false,
            },
            series: {
                lineStyle: {
                    width: "1px",
                    smooth: true,
                },
                topPoint:{
                    shape:"circle",
                    fillColor:"#F9A11C"
                },
                headPoint: {
                    shape: "circle",
                    size: 20,
                    strokeWidth: 1,
                    fillColor: '#ffffff',
                    strokeColor: '#007aff',
                    display: true,
                },
                loop: {
                    margin: 2,
                }
            }
        },
    },

    refresh() {
        //发起网络请求
        fetch.fetch({
            url:`http://124.70.109.103:8000/hmImgInfo/HmInfo/`,//路径
            data: qs.stringify({'id': this.id_data}),
            responseType: "json",
            method: "POST",
            success:(resp)=>
            {
                this.result_list = []  // 列表置空
                this.result_list = JSON.parse(resp.data);  // 将JSON字符串转换为JSON对象，并赋值给result_list
            },
            fail:(resp)=>
            {
                console.log("获取数据失败："+resp.data)
            }
        });
    },

}
